<html>
<head><meta charset="utf-8"><title>Error Return Traces · project-error-handling · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/index.html">project-error-handling</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Error.20Return.20Traces.html">Error Return Traces</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214202964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Error%20Return%20Traces/near/214202964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Error.20Return.20Traces.html#214202964">(Oct 22 2020 at 15:24)</a>:</h4>
<p>Zig has a very cool feature I just learned about:</p>
<p><a href="https://ziglang.org/documentation/master/#Error-Return-Traces">https://ziglang.org/documentation/master/#Error-Return-Traces</a></p>
<p>The basic idea seems to be that the runtime automatically records every time a function returns an error, so that if the program exits with an error, the entire chain of "error events" can be printed, even if those errors were recovered from. (It may clear the record once a function returns without an error; I'm not sure.)</p>
<p>This is of course quite a bit of compiler magic, probably more than Rust can afford to add to all error types globally. But perhaps there's a way to achieve something similar in an opt-in way?</p>



<a name="214203154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Error%20Return%20Traces/near/214203154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Error.20Return.20Traces.html#214203154">(Oct 22 2020 at 15:25)</a>:</h4>
<p>I wrote a pre rfc for this a while ago and it's already mentioned on the charter</p>



<a name="214203288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Error%20Return%20Traces/near/214203288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Error.20Return.20Traces.html#214203288">(Oct 22 2020 at 15:26)</a>:</h4>
<p><a href="https://paper.dropbox.com/doc/Collaborative-Summary-3-Fact-Finding-Pre-RFCs-around-Error-Handling-Reporting-dnShKo1SsHtdF4Yheeoco">https://paper.dropbox.com/doc/Collaborative-Summary-3-Fact-Finding-Pre-RFCs-around-Error-Handling-Reporting-dnShKo1SsHtdF4Yheeoco</a></p>



<a name="214203337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Error%20Return%20Traces/near/214203337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Error.20Return.20Traces.html#214203337">(Oct 22 2020 at 15:26)</a>:</h4>
<p>but yea, I think we can definitely have error return traces in rust</p>



<a name="214203489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Error%20Return%20Traces/near/214203489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Error.20Return.20Traces.html#214203489">(Oct 22 2020 at 15:27)</a>:</h4>
<p>Oh! I must have glossed over that before. Nice.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>